<%@page contentType="text/html;charset=utf-8" pageEncoding="UTF-8" %>
<%@page import="org.ipo.mm.web.util.ConstantManager, java.util.Collection, org.ipo.mm.web.util.security.SecurityManager" %>
<%@taglib prefix="h" uri="http://struts.apache.org/tags-html"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="l" uri="http://struts.apache.org/tags-logic" %>
<%@ taglib prefix="b" uri="http://struts.apache.org/tags-bean" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>


<h1><b:message key="reports_title"/></h1>

<div id="reportsTab">
 <h:form styleClass="form" action="/protected/reports_menu" styleId="reportParamForm"
         enctype="multipart/form-data; charset=utf-8">

     <ul>
	<li><a href="#institutionsReports"> <b:message key="reports_group_inst"/> </a></li>
	<li><a href="#meetingsReports"><b:message key="reports_group_meetings"/></a></li>
	<li><a href="#representativesReports"><b:message key="reports_group_repr"/></a></li>
	
	
</ul>
<div id="institutionsReports">
 <fieldset>
 <legend><b:message key="reports_group_inst"/></legend>
<b><input type="radio" name="reportName" value="reports_inst_by_family" class="selectFamilies"><b:message key="reports_inst_by_family"/></b><br>
<input type="radio" name="reportName" value="reports_inst_by_type"class="selectTypes"><b:message key="reports_inst_by_type"/><br>
<b><input type="radio" name="reportName" value="reports_inst_by_region" class="selectRegions"><b:message key="reports_inst_by_region"/></b><br>
</fieldset>
</div> 
<div id="meetingsReports">
    <fieldset>
        <legend><b:message key="reports_group_meetings"/></legend>
<b><input type="radio" name="reportName" value="reports_meeting_by_inst" class="selectInstitutions"><b:message key="reports_meeting_by_inst"/></b><br>
<!--<input type="radio" name="reportName" value="reports_meeting_by_family"class="selectFamilies"><b:message key="reports_meeting_by_family"/><br>
<input type="radio" name="reportName" value="reports_meeting_by_type" class="selectTypes"><b:message key="reports_meeting_by_type"/><br>
<input type="radio" name="reportName" value="reports_meeting_by_region" class="selectRegions"><b:message key="reports_meeting_by_region"/><br>
-->
</fieldset>
</div>

<div id="representativesReports">
    <fieldset>
        <legend><b:message key="reports_group_repr"/></legend>
<b><input type="radio" name="reportName" value="reports_repr_by_inst" class="selectInstitutions"><b:message key="reports_repr_by_inst"/></b><br>
<b><input type="radio" name="reportName" value="reports_repr_by_family" class="selectFamilies"><b:message key="reports_repr_by_family"/></b><br>
<b><input type="radio" name="reportName" value="reports_repr_by_type" class="selectTypes"><b:message key="reports_repr_by_type"/></b><br>
<b><input type="radio" name="reportName" value="reports_repr_by_region" class="selectRegions"><b:message key="reports_repr_by_region"/></b><br>
</fieldset>
</div>



<h:submit property="print"><b:message key="gen_print"/></h:submit>
 
<div id="selectRegions">
 <table id="rep_regionListTable" class="display">
<thead>
<tr>
    <th class="do-not-sort"><b:message key="reports_select_all_none"/> <input type='checkbox' id='checkAllRegions'></th>
    <th> <b:message key="menu_regions"/> <b:message key="regions_name"/></th>
</tr>
</thead>
<tbody>
    <l:iterate id="region" name="allRegions" scope="request">
    <tr>
        <td><input type='checkbox' value='<b:write name="region" property="id"/>' name='idsCollection'></td>
	    <td><b:write name="region" property="name"/></td>
    </tr>
    </l:iterate>
</tbody>
</table>
</div>
<div id="selectFamilies">
 <table id="rep_familyListTable" class="display">
<thead>
<tr>
    <th class="do-not-sort"><b:message key="reports_select_all_none"/> <input type='checkbox' id='checkAllFamilies'></th>
    <th><b:message key="entity_family_name"/></th>
</tr>
</thead>
<tbody>
    <l:iterate id="family" name="allFamilies" scope="request">
    <tr>
        <td><input type='checkbox' value='<b:write name="family" property="id"/>' name='idsCollection'></td>
	    <td><b:write name="family" property="name"/></td>
    </tr>
    </l:iterate>
</tbody>
</table>
</div>


<div id="selectTypes">
 <table id="rep_typeListTable" class="display">
<thead>
<tr>
    <th class="do-not-sort"><b:message key="reports_select_all_none"/> <input type='checkbox' id='checkAllTypes'></th>
    <th><b:message key="entity_type_name"/></th>
</tr>
</thead>
<tbody>
    <l:iterate id="type" name="allTypes" scope="request">
    <tr>
        <td><input type='checkbox' value='<b:write name="type" property="id"/>' name='idsCollection'></td>
	    <td><b:write name="type" property="name"/></td>
    </tr>
    </l:iterate>
</tbody>
</table>
</div>

<div id="selectInstitutions">
<table id="rep_instututionListTable" class="display">
<thead>
<tr>
    <th ><b:message key="reports_select_all_none"/> <input type='checkbox' id='checkAllInstitutions'></th>
    <th><b:message key="menu_institutions"/></th>
</tr>
</thead>
<tbody>
    <l:iterate id="institution" name="allInst" scope="request">
    <tr>
        <td><input type='checkbox' value='<b:write name="institution" property="id"/>' name='idsCollection'></td>
	    <td><b:write name="institution" property="name"/></td>
    </tr>
    </l:iterate>
</tbody>
</table>
</div>
</h:form>

<script type="text/javascript">	
$('div[id*="select"]').hide();
function uncheckAllTables(){
$('input', rep_regionListTable.fnGetNodes()).attr('checked',false);
$('input', rep_typeListTable.fnGetNodes()).attr('checked',false);
$('input', rep_familyListTable.fnGetNodes()).attr('checked',false);
$('input', rep_instututionListTable.fnGetNodes()).attr('checked',false);
$("input[type='checkbox']").attr('checked',false);

}


</script>
</div>	